import Vue from 'vue'
import request from '@/itsoftUI/utils/request'
import qs from "qs"
const baseUrl = Vue.prototype.$itsoftUI.config.serviceUrl + "/trans"
//数据交换
const apiTrans = {
    // 获取数据交换的明细
    openTrans: function (transRepositoryId, scriptPath, scriptName,imageFilePath) {
        const data = {
            transRepositoryId, scriptPath, scriptName,imageFilePath
        }
        return request({
            url: baseUrl + '/open',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //创建转换步骤
    newStep: function (graphXml,pluginId,name) {
        const data = {
            graphXml,pluginId,name
        }
        return request({
            url: baseUrl + '/newStep',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //保存
    save: function (transRepositoryId,graphXml) {
        const data = {
            transRepositoryId,graphXml
        }
        return request({
            url: baseUrl + '/save',
            method: 'post',
            data: qs.stringify(data)
        })
    },
}
export {apiTrans}
